{extend name='public/layer_base' /}
{block name='content'}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-row">
                <form class="layui-form" method="post">

                    <div class="layui-form-item">
                        <label for="name" class="layui-form-label">名称</label>
                        <div class="layui-input-inline">
                            <input maxlength="50" id="name" name="name" value="{$data.name|default=''}"
                                class="layui-input" placeholder="请输入名称">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="description" class="layui-form-label">简介</label>
                        <div class="layui-input-inline">
                            <input maxlength="50" id="description" name="description" value="{$data.description|default=''}"
                                class="layui-input" placeholder="请输入简介">

                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="nickname" class="layui-form-label">
                            启用状态</label>
                        <div class="layui-input-inline">
                            <input type="checkbox" lay-skin="switch" lay-filter="status" value="1" {if isset($data) &&
                                $data.status==1} checked {/if}>
                            <input type="hidden" name="status" value="{$data.status|default='0'}">
                        </div>
                        <script>
                            layui.use('form', function () {
                                var form = layui.form;
                                form.on('switch(status)', function (data) {
                                    $('input[name=status]').val(data.elem.checked ? '1' : '0');
                                })
                            })
                        </script>
                    </div>
                    <div class="layui-form-item">
                        <label for="L_repass" class="layui-form-label"></label>
                        <button class="layui-btn" lay-filter="submit" id="submit" lay-submit="submit"
                            type="button">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

{/block}